//
//  WYPusherMessageController.m
//  CirclePush
//
//  Created by admin on 2018/4/19.
//  Copyright © 2018年 admin. All rights reserved.
//

#import "WYPusherMessageController.h"
#import "WYPusherMessageCell.h"

@interface WYPusherMessageController ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic,strong)UITableView *tableView;
@end

@implementation WYPusherMessageController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupUI];
    // Do any additional setup after loading the view.
}
-(void)setupUI
{
    [self.view addSubview:self.tableView];
    [self initTopBarWithTitle:@"消息通知"];
    [self addLeftButton:[UIImage imageNamed:@"return"] width:0 height:0];
    [self.tableView registerNib:[UINib nibWithNibName:@"WYPusherMessageCell" bundle:nil] forCellReuseIdentifier:@"WYPusherMessageCell"];
    self.tableView.estimatedRowHeight=100;
    self.tableView.rowHeight =UITableViewAutomaticDimension;
    
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 5;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    WYPusherMessageCell *cell = [tableView dequeueReusableCellWithIdentifier:@"WYPusherMessageCell" forIndexPath:indexPath];
    if (!cell) {
        cell = [[NSBundle mainBundle]loadNibNamed:@"WYPusherMessageCell" owner:nil options:nil].firstObject;
    }
    
    
    
    return cell;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(UITableView *)tableView
{
    if (!_tableView) {
        _tableView = [[UITableView alloc]init];
        _tableView.dataSource=self;
        _tableView.delegate = self;
        _tableView.frame = CGRectMake(0, NavHeight, kScreenWidth, kScreenHeight);
    }
    return _tableView;
}

@end
